﻿import com.dmotiko.general.*
import com.dmotiko.bolacua.*
import com.dmotiko.util.*

class RoomPhotoLoader
extends MovieLoaderClip {
	
	private var interpolate:Function;
	private var interpolator:MovieClip;
	
	private function RoomPhotoLoader() {
		super();
		MovieEffects.fadeIn();
		MovieEffects.interpolate();
		MovieEffects.timer();
	}
	
	private function refreshData() {
		var photo:PhotoData = PhotoData( data );
		this.loadContent( photo.getIcon() );
	}
	
	public function onRollOver() {
		this.interpolator.stopEffect();
		this.interpolator = this.interpolate( { prop: "_alpha", init: this._alpha, end: 60, ratio: 5 } );
	}
	
	public function onRollOut() {
		this.interpolator.stopEffect();
		this.interpolator = this.interpolate( { prop: "_alpha", init: this._alpha, end: 100, ratio: 5 } );
	}
	
	public function onRelease() {
		dispatchEvent( { target: this, type: BaseClipEvent.CHANGED } );
	}
	
	public function onLoadInit(target) {
		
		this.mcContainer._alpha = 0;
		this.mcContainer.fadeIn( { rate: 5 } );
		this.mcContainer.timer( { frames: 3, bind: this, listener: super.onLoadInit } );
		
	}
	
}